let a: number = 1213432
const b: string = 'sdhw'

let c: any = 'sdfe'
let d: number[] = [1, 2, 4, 6]
let e: string[] = ['sd', 'v', 'd']
let f: [number, string, boolean] = [1, '2', true]
let h: null = null

// 枚举（enum）
// 字符串枚举
enum Person {
  li = '李',
  liu = '刘',
  cui = '崔'
}

let li: Person = Person.li

//数字枚举
enum Num {
  a,
  b = 12,
  c
}

let Num1: Num = Num.a
console.log(Num1)

let obj1: {
  a: number,
  b: string,
  c: boolean
} = {
  a: 1,
  b: 'shdu',
  c: true
}

let obj2: IObj = {
  a: 12,
  b: '12',
  c: false,
  abs() {
    console.log('2222')
  }
}


// 接口
interface IObj {
  a: number,
  b: string,
  c: boolean,
  abs(): void
}

class Arr implements IObj {
  a: 1;
  b: '1';
  c: false;
  abs() {
    console.log('111')
  }
}

function Fun(a: number, b: number): number {
  return a + b
}

Fun(2, 4)

// 类
class Chinese {
  name: string;
  age: number;

  // 构造函数
  constructor(a, b) {
    this.name = a
    this.age = b
  }

  jump() {
    alert(`${this.name}今年${this.age}`)
    console.log(this.name + '今年' + this.age + '岁')
  }
}

// 实例化
let zs = new Chinese("张三", 18)
zs.jump()


// 数字型
let num = 123

console.log(num.toLocaleString())

//字符串
let Str = '123'

console.log(Str.anchor('shu'))
console.log(Str.includes('1'))
console.log(Str.replace('123', '456'))
console.log(Str.)